package com.hengpeng.itfinoss.controller.monitor;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hengpeng.common.monitor.LoadStatus;
import com.hengpeng.common.monitor.dto.ServerStatus;
import com.hengpeng.common.monitor.dto.VmStatus;
import com.hengpeng.itfinoss.controller.BaseController;

/**
 * 系统监控
 * @author
 */

@Controller
@RequestMapping(value = "/monitor")
public class MonitorController extends BaseController
{
	private String jspPath(String pageName)
	{
		return "monitor/" + pageName;
	}

	@RequestMapping(value = "/itfinbs/status")
	public String bsStatus(ModelMap map, HttpServletRequest request)
	{
		return jspPath("/statusbs");
	}

	@RequestMapping(value = "/status")
	public String ossStatus(ModelMap map, HttpServletRequest request)
	{
		return jspPath("/statusoss");
	}

	@RequestMapping(value = "/serverstatus")
	public String ossserverstatus(ModelMap map, HttpServletRequest request)
	{
		ServerStatus loadServerStatus = LoadStatus.loadServerStatus();
		map.put("serverstatus", loadServerStatus);
		VmStatus vmStatus = LoadStatus.loadVmStatus();
		map.put("vmstatus", vmStatus);
		return jspPath("/systemstatus");
	}

	@RequestMapping(value = "/itfints/status")
	public String tsStatus(ModelMap map, HttpServletRequest request)
	{
		return jspPath("/statusts");
	}
}
